//
//  CZQSearchBar.m
//  weibo
//
//  Created by Apple on 15-1-31.
//  Copyright (c) 2015年 itcast. All rights reserved.
//

#import "CZQSearchBar.h"

@implementation CZQSearchBar

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setup];
    }
    return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self setup];
    }
    return self;

}
- (void)setup{
    
    
    self.placeholder = @"请输入内容";
    
    UIImageView *iconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"searchbar_searchlist_search_icon"]];
    self.leftViewMode = UITextFieldViewModeAlways;
    self.leftView = iconView;
    self.clearButtonMode = UITextFieldViewModeAlways;
    //tabBar的框显示
    self.borderStyle = UITextBorderStyleRoundedRect;
}
- (void)setLeftIconName:(NSString *)LeftIconName{

    _LeftIconName = LeftIconName;
    UIImageView *icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:LeftIconName]];
    icon.width = 30;
    icon.contentMode = UIViewContentModeCenter;
    self.leftView = icon;

}
@end
